def a(n):
    b = 1
    sum = 0

    if int(n) == 1:
        print('1')
    else:
        for i in range(1, (n + 1)):
            b *= i
            sum += b
    return sum

digit = int(input('input a digit'))
sum = a(digit)
print(sum)